from selenium.webdriver.common.by import By
from home_wechat.page_object.base_page import BasePage
from home_wechat.utils.log_utils import logger

class ContactPage(BasePage):

    __TIPS_VALUE = (By.CSS_SELECTOR, "#js_tips")
    __DEP_VALUE = (By.CSS_SELECTOR, "#js_tips")

    def add_member_page(self):
        tips_value = self.wait_element_until_visible(self.__TIPS_VALUE)
        msg = tips_value.text
        logger.info(f"冒泡消息为：{msg}")
        # ==》返回消息文本
        return msg

    def add_department_page(self):
        dep_value = self.wait_element_until_visible(self.__DEP_VALUE)
        msg = dep_value.text
        logger.info(f"冒泡消息为：{msg}")
        # ==》返回消息文本
        return msg